package kr.hkit.powerjava.chapter14;

import java.awt.GridLayout;
import java.awt.HeadlessException;

import javax.swing.JButton;
import javax.swing.JFrame;

class MyFrame extends JFrame {

	public MyFrame() throws HeadlessException {
		setTitle("GridLayout Test");
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setLayout(new GridLayout(0,3));
		
		add(new GridButton());
		
		pack();
		setVisible(true);
		
	}
	
}

class GridButton extends JButton{
	
	public GridButton() {
		JButton btn01 = new JButton("Button1");
		JButton btn02 = new JButton("Button2");
		JButton btn03 = new JButton("Button3");
		JButton btn04 = new JButton("B4");
		JButton btn05 = new JButton("Long Button5");
	}
	
	
}

public class GridTest {
	public static void main(String[] args) {
		MyFrame mf = new MyFrame();
	}
}
